#pragma once

class CBaseWriter
{
public:
  static const TCHAR eol[];

public:
  virtual bool Open(const TCHAR* szFile, bool bUtf8 = true) = 0;
  virtual void Close() = 0;

  virtual bool Write(const TCHAR* s) = 0;

  virtual bool WriteLine(const TCHAR* s)
  { return Write(s) && Write(eol); }
  virtual bool WriteSection(const TCHAR* name)
  { return Write(TEXT("[")) && Write(name) && WriteLine(TEXT("]")); }
  virtual bool WritePair(const TCHAR* key, const TCHAR* val, TCHAR delim = TEXT('='));
};
